package sliver.entity;

import java.io.Serializable;

import javax.persistence.Access;
import javax.persistence.AccessType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import com.alibaba.fastjson.annotation.JSONField;

@Entity
@Table(name = "box_item")
@Access(AccessType.FIELD)
public class Item implements Serializable{

	private static final long serialVersionUID = -5250380625816952838L;
	
	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	@Column(name = "id")
	private Long id;
	
	@Column(name = "buy_price")
	private Double buyPrice;
	
	@Column(name="buy_count")
	private Double buyConut;
	
	@Column(name = "size_type")
	private String type;
	
	@ManyToOne
	@JoinColumn(name = "goods_id")
	private Goods goods;
	
	@ManyToOne
	@JoinColumn(name = "order_id")
	private Order order;
	
	public Item(){
		
	}

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public Double getBuyPrice() {
		return buyPrice;
	}

	public void setBuyPrice(Double buyPrice) {
		this.buyPrice = buyPrice;
	}

	public Double getBuyConut() {
		return buyConut;
	}

	public void setBuyConut(Double buyConut) {
		this.buyConut = buyConut;
	}
	
	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
	}

	public Goods getGoods() {
		return goods;
	}

	public void setGoods(Goods goods) {
		this.goods = goods;
	}
	
	@JSONField(serialize = false, deserialize = false)
	public Order getOrder() {
		return order;
	}

	public void setOrder(Order order) {
		this.order = order;
	}
}
